//
//  GameCollectionViewCell.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2021/12/10.
//

#import "GameCollectionViewCell.h"

@interface GameCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *cellImage;
@property (weak, nonatomic) IBOutlet UILabel *cellTitle;

@property (weak, nonatomic) IBOutlet UILabel *rightSubTitle;

@end

@implementation GameCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contentView.backgroundColor = [UIColor whiteColor];
    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
    
//    self.cellImage.layer.cornerRadius = 5;
//    self.cellImage.layer.masksToBounds = YES;
}

- (void)setModel:(GameModel *)model
{
    [self.cellImage yy_setImageWithURL:[NSURL URLWithString:model.gameDetail.iconUrl] placeholder:placeholder_image];
    self.cellTitle.text = model.gameDetail.mainTitle;
    self.rightSubTitle.text = [NSString stringWithFormat:@"%@", model.commentTotal];
}

CGFloat GameCollectionViewCell_Width()
{
    return (SL_WINDOW_WIDTH - 40 - 20)/2;
}

CGFloat GameCollectionViewCell_Height()
{
    return GameCollectionViewCell_Width() + 10 + 17 + 10 + 15 + 10;
}

@end
